package com.jtoon.dao;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;

import com.jtoon.bean.Comics;
import com.jtoon.util.PMF;

public class ComicsD {
	
	public List<Comics> getComicsList() {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		List<Comics> comicsList = null;
		Query query = pm.newQuery(Comics.class);
		comicsList = (List<Comics>)query.execute();
		return comicsList;
	}
	
	public void comicsAdd(Comics comics){
		PersistenceManager pm = PMF.get().getPersistenceManager();
		pm.makePersistent(comics);
	}
	
	public void comicsDelAll(){
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Query query = pm.newQuery(Comics.class);
		List<Comics> comicsList = (List<Comics>)query.execute();
		pm.deletePersistentAll(comicsList);
	}
	
}
